<script language='javascript'>
    var winForm;
    $(document).ready(function() {
        var icons = {
            header: "ui-icon-circle-arrow-e",
            activeHeader: "ui-icon-circle-arrow-s"
        };
        $(function() {
            $( "#accordionObjects" ).accordion({
//                icons: icons,
                collapsible:true
            });
        });
    });
</script>
<input id="hd_context" type="hidden" value="<?php echo $breadcumb;?>"/>
<?php    $urlSummary = base_url()."/index.php/modules/summary/1";   ?>
<ul class='ul_page' style="margin:0px;">
    <li>
        <h2 style="margin-left: 5%;margin-top: 20px;">Categorías de Temas</h2>
        <h2><a style="margin-left: 5%;font-size:12px;" href="<?php echo $urlSummary;?>">(Cambiar a vista de Resumen)</a></h2>
        <div id="accordionObjects">
            <?php
            
//            print_r($categories);exit;
            
            foreach ($categories as $category) {  
                $categoryName = "";
                if(!empty($category[0]))
                    $categoryName = $category[0]->category;              
            ?>
                <h3><?php echo $categoryName; ?></h3>
            <?php
                foreach ($category as $object) {
                    $onclick = "";
                    $url = base_url() . "index.php/objects/index/" . $object->id;
                    $urlEdit = base_url() . "index.php/objects/modify/" . $object->id;
            ?>
                        <div>
                                <h4><a onclick="<?php echo $onclick;?>" href="<?php echo $url; ?>"><?php echo $object->name; ?></a></h4>
                                <p><?php echo $object->description; ?></p>
                                <?php if($user_id == $object->users_id){ ?>
                                    <span><a href="<?php echo $urlEdit;?>">(Editar Tema)</a></span>
                                <?php }?>
                        </div>    
                <?php
                }?>
                
           <?php
            }
        ?>
        </div>
    </li>
</ul>
